Adding color helper functions and better validation on style registration#673
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a locking mechanism for the timeline style registry and adds color validation to ensure RGBA values are within the [0, 1] range. It also provides utility functions for sRGB hex conversion and renames registration functions to MustRegister... to reflect their panicking behavior. Feedback focuses on correcting a typo and casing in MustForceConvertsRGBHex, adding explicit validation for the # prefix in hex strings, and maintaining naming consistency in tests. The reviewer also highlighted that renaming registration functions constitutes a breaking change.
8df7c43 to
a19763b
Compare
renamoo
left a comment
There was a problem hiding this comment.
I'm not sure if we cares about it so just leaving a note that I noticed some error message starts with capital letters and some does not.
e.g.)
t.Errorf("MustForceConvertSRGBHex() mismatch (-want +got):\n%s", diff) <- start with capital
t.Errorf("expected panic, but did not panic") <- does not start with capital
a19763b to
9f400fc
Compare
Error messages used in Go shouldn't be capitalized especially if it is used as the |
9f400fc to
1f0a610
Compare
b295be3
into
GoogleCloudPlatform:epic/file-schema-v6
The new file format embeds style information in the file. The older file format expect its client to have associated generated style files.
This change added some validation logics on these styles: